﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CommonImageInput.ascx.cs" Inherits="admin_webparts_Plug_ins_CommonPage_CommonImageInput" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.Web.BL.CommonPage" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<script type="text/javascript">
NTTHAO.namespace('page');

NTTHAO.page.langText = [];
NTTHAO.page.langText['BLANK_HEADER'] = '<%=LanguageUtility.GetLanguageText("BLANK_HEADER", Session)%>';
NTTHAO.page.langText['INVALID_IMAGE_FILE'] = '<%=LanguageUtility.GetLanguageText("INVALID_IMAGE_FILE", Session)%>';

function doSubmit() {
    var txtImageName1 = document.getElementById("<%=this.txtImageName1.ClientID %>");
    var fuImage1 = document.getElementById("<%=this.fuImage1.ClientID %>");
    var imageEx = "<%=Constant.IMAGE_FILE_EXTENTIONS %>".split(" ");

    var errorMessage = "";
    /*
    errorMessage = CheckFieldString("noblank", txtImageName, NTTHAO.page.langText['BLANK_HEADER']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtImageName1.select();
        txtImageName1.focus();
        return false;
    }
    */
    <%if (this._Detail == null)
      { %>
    errorMessage = CheckFieldString("noblank", fuImage1, NTTHAO.page.langText['INVALID_IMAGE_FILE']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        fuImage1.focus();
        return false;
    }
    <%} %>
    
    var imgFileName1 = Trim(fuImage1.value);
    if (!checkFileType(imgFileName1, imageEx)) {
        alert(NTTHAO.page.langText['INVALID_IMAGE_FILE']);
        fuImage1.focus();
        return false;
    }
    
    return true;
}
</script>
<style type="text/css">
    #spCancel1, #spSave, #spCancel2, #spSave2 {font-size:1.1em; font-weight: bold; }
    #spCancel1 button, #spSave button, #spCancel2 button, #spSave2 button { font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; }
</style>
<div class="tip">
	<h1><%=LanguageUtility.GetLanguageText("IMAGE_FILE_INPUT", Session)%></h1>
</div>
<form id="frmInput" runat="server" onsubmit="return doSubmit();">
<p style="text-align: left;">
    <span id="spSave" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel1" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?action=viewalbum&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=this.Request.QueryString["mnuid"] %>&id=<%=this.Request.QueryString["albumid"] %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave", function () {
            var spSave = new YAHOO.widget.Button("spSave");
        });
        YAHOO.util.Event.onContentReady("spCancel1", function () {
            var spCancel1 = new YAHOO.widget.Button("spCancel1");
        });
    </script>
</p>
<%if (_ErrorMessage != string.Empty) { %>
<div class="tip" style="margin: 10px auto;"><span style="color: Red; font-weight: bold;"><%=_ErrorMessage.Replace(Environment.NewLine, "<br />") %></span></div>
<%} %>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even" style="vertical-align: middle; height: 50px; line-height: 24px;">
        <td>
            <asp:CheckBox ID="chkResizeImage" runat="server" Checked="true" Text="Resize all." onclick="document.getElementById('spanResizeImageSize').style.display = (this.checked ? '' : 'none');" />
            <span id="spanResizeImageSize">Maximum size:&nbsp;&nbsp;<asp:TextBox ID="txtResizeImageWidth" runat="server" Text="1024" Width="50px"></asp:TextBox> x <asp:TextBox ID="txtResizeImageHeight" runat="server" Text="1024" Width="50px"></asp:TextBox><b> pixels</b></span>
        </td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName1" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage1" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <%if (this._Detail != null)
      { %>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("CURRENT_IMAGE", Session)%>:</td>
        <td>
            <img alt="" src="../<%=this._Album.ImagePath + this._Detail.ImageFileName %>" style="max-width: 200px; max-height: 150px;" />
        </td>
    </tr>
    <%} %>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL1" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive1" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<%if (this._Detail == null) { %>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName2" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage2" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL2" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive2" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName3" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage3" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL3" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive3" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName4" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage4" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL4" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive4" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName5" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage5" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL5" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive5" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName6" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage6" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL6" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive6" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName7" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage7" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL7" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive7" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName8" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage8" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL8" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive8" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName9" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage9" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL9" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive9" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HEADER", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtImageName10" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("IMAGE", Session)%>:
        </td>
        <td>
            <asp:FileUpload ID="fuImage10" runat="server"/>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("LINK", Session)%>:
        </td>
        <td>
            http:// <asp:TextBox ID="txtURL10" runat="server" Width="362px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive10" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<%} %>
<p style="text-align: left;">
    <span id="spSave2" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave2" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel2" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?action=viewalbum&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=this.Request.QueryString["mnuid"] %>&id=<%=this.Request.QueryString["albumid"] %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave2", function () {
            var spSave2 = new YAHOO.widget.Button("spSave2");
        });
        YAHOO.util.Event.onContentReady("spCancel2", function () {
            var spCancel2 = new YAHOO.widget.Button("spCancel2");
        });
    </script>
</p>
</form>
